home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
-
- /*
- * seqgrab.c - sequential frame accurate grabbing on Galileo w/hw trigger
- *
- * Grabs a sequence of frames between start and end timecodes. This
- * works on a very specific configuration of equipment, namely a
- * system with a Galileo video board, a frame accurate device and a
- * VLAN controller.
- *
- * Note: this app currently does not support framedrop timecode.
- *
- * John Magdziarz 01.31.94
- *
- */
-
- #include <unistd.h>
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <signal.h>
- #include <malloc.h>
- #include <getopt.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <gl/gl.h>
- #include <gl/image.h>
- #include <vl/vl.h>
- #include "vlan.h"
- #include "cv.h"
-
- char *deviceName;
- char *_progName;
-
- #ifndef MAXNAMLEN
- #define MAXNAMLEN 1024
- #endif
-
- #define CMDLEN 20
- #define MAXFGRAB 3
- #define MINENDPOINT 5
-
- int icount = 0;
- char iname[MAXNAMLEN];
- char outfilename[MAXNAMLEN - 5] = "";
- int captCount = 0;
- int writeFrame = 1;
- int forcedWriteFrame = 0;
- int rawMode = 0;
- int displayFrame = 0;
- int decodeTC = 0;
- VLServer svr;
- VLBuffer buffer;
- VLPath path;
- VLNode src, drn;
- VLTransferDescriptor xferDesc;
- int xsize = 0;
- int ysize = 0;
- int xsetsize = 0;
- int ysetsize = 0;
- int frameSize;
- char *strSC = "SC ";
- char *strSI = "SI ";
- char *strSO = "SO ";
- char *strPR = "PR ";
- char tcSI[CMDLEN], cmdSI[CMDLEN];
- char tcSO[CMDLEN], cmdSO[CMDLEN];
- char tcSC[CMDLEN], cmdSC[CMDLEN];
- char tcPR[CMDLEN], cmdPR[CMDLEN];
- int fcntSI;
- int fcntSO;
- char tcTMP[CMDLEN];
- int lastCoinFr;
- char cmd[256], buf[256], *cmdName, *response;
- Boolean inpoint = FALSE;
- Boolean outpoint = FALSE;
- int totalFrames = 0;
- int totalTriggers = 0;
- int remFrames = 0;
- int offset = -1;
- ulong tc, ub, crc;
-
- VLDevList devlist;
- VLControlValue val;
- int c;
- int vin;
- int devicenum = -1;
- int forced_node = 0;
- int zoom_num = 1;
- int zoom_denom = 1;
- int ext_trig = 1; /* always hang out for external trigger */
- int node = 0;
- int verbose = 0;
- int deinterlace = 0;
-
- void docleanup();
- void ProcessEvent(VLServer, VLEvent *, void *);
- void usage(void);
- char *get_packing(void);
- int reportPerf(int);
-
- #define GRABFILE "out"
-
- #define USAGE \
- "%s: -i <start SMPTE tc> -o <end SMPTE tc> [-f <filename>]\n\
- \t\t[-w] [-d] [-s w h] [-n <device>] [-v <videonode> ]\n\
- \t\t[-c <num>] [-r] [-t] [-z n/d] [-O <frames>] [-D] [-h]\n\
- \t-i\tstarting <SMPTE timecode> to grab frames\n\
- \t-o\tending <SMPTE timecode> to grab frames\n\
- \t-f\toutput filename\n\
- \t-w\tdon't write frame to disk\n\
- \t-d\tdisplay captured frame\n\
- \t-s w h\tframe dimensions (must be last option if specified)\n\
- \t-c num\tnumber of frames to capture\n\
- \t-n device\tdevice number to use\n\
- \t-r\traw mode output (no YUV->RGB or de-interlace)\n\
- \t-v\tvideo source node number\n\
- \t-z\tzoom the image by n/d\n\
- \t-O\toffset # frames from starting timecode (default = -1)\n\
- \t-p\tpreroll time <SMPTE timecode> (default 5 sec.)\n\
- \t-V\tverbose\n\
- \t-D\tde-interlace captured frame (repeat even field)\n\
- \t-h\tthis help message\n"
-
- void
- usage(void)
- {
- fprintf(stderr, USAGE, _progName);
- }
-
-
- /* Dump data to image file */
- void
- DumpImage(char *data, int xinputsize, int xoutputsize, int yinputsize,
- int youtputsize, int transferSize)
- {
- IMAGE *image;
- int fd, ret;
- unsigned short rbuf[1024];
- unsigned short gbuf[1024];
- unsigned short bbuf[1024];
- char *outdata, *temp;
- int fileSize;
- int x, y, z;
- int yinc;
-
- sprintf(iname,"%s-%05d", outfilename, icount++);
- if (rawMode)
- {
- strcat(iname, ".");
- strcat(iname, get_packing());
- fd = open(iname, O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (fd < 0)
- {
- perror(iname);
- exit(1);
- }
- /* Do clipping if requested */
- if ((xinputsize != xoutputsize)||(yinputsize != youtputsize))
- {
- fileSize = youtputsize * xoutputsize * 2;
- outdata = (char *)malloc(fileSize*sizeof(char));
- if (!outdata)
- {
- fprintf(stderr,"DumpImage: can't malloc enough memory\n");
- exit(1);
- }
- temp = outdata;
- for (y = 0; y < youtputsize; y++)
- {
- for (x = 0; x < xoutputsize; x++)
- {
- *(temp++) = *(data++);
- *(temp++) = *(data++);
- }
- /* Clip data to user requested frame size */
- for (x = xoutputsize; x < xinputsize; x++)
- {
- data++;
- data++;
- }
- }
- ret = write(fd, outdata, fileSize);
- free(outdata);
- }
- else
- {
- fileSize = transferSize;
- ret = write(fd, data, fileSize);
- }
- if (ret < fileSize)
- {
- perror(iname);
- exit(1);
- }
- close(fd);
- } else
- {
- if (writeFrame)
- {
- strcat(iname, ".rgb");
- image = iopen(iname, "w", RLE(1), 3, xoutputsize, youtputsize, 3);
- }
-
- /* Write RGB data to buffers */
- /* double even fields to deinterlace image */
- if (deinterlace)
- yinc = 2;
- else
- yinc = 1;
- for (y=0;y<youtputsize;y+=yinc)
- {
- /* One pixel at a time along scan line */
- for(x=0;x<xoutputsize;x++)
- {
- data++;
- bbuf[x] = *(data++);
- gbuf[x] = *(data++);
- rbuf[x] = *(data++);
- }
- /* Clip data to user requested frame size */
- for (x=xoutputsize; x<xinputsize; x++)
- {
- data++;
- data++;
- data++;
- data++;
- }
- if (writeFrame)
- {
- /* Write RGB buffers to disk */
- putrow(image, rbuf, youtputsize - y - 1, 0);
- putrow(image, gbuf, youtputsize - y - 1, 1);
- putrow(image, bbuf, youtputsize - y - 1, 2);
- putrow(image, rbuf, youtputsize - y - 2, 0);
- putrow(image, gbuf, youtputsize - y - 2, 1);
- putrow(image, bbuf, youtputsize - y - 2, 2);
- }
- }
- if (writeFrame)
- iclose(image);
- }
- }
-
-
-
- char *ToUpper(char *str) {
- char *c;
- if ((c = str) != NULL)
- for (; *c != '\0'; c++)
- if (*c >= 'a' && *c <= 'z') *c += 'A' - 'a';
- return str;
- }
-
- void
- setVCmdStr(char *cmd, char *cmdstr, char *tcstr, char *tc)
- {
- strncpy(tcstr, tc, CMDLEN);
- strncpy(cmd, cmdstr, CMDLEN);
- strncat(cmd, tcstr, CMDLEN);
- }
-
- void
- parseOptions(int argc, char **argv)
- {
- while ((c = getopt(argc, argv, "f:wdn:c:rhs:v:z:ti:o:O:p:DVT")) != EOF)
- {
- switch (c)
- {
- case 'f':
- sprintf(outfilename,"%s",optarg);
- break;
-
- case 'c':
- captCount = atoi(optarg);
- if (captCount > MAXFGRAB) {
- printf("capture count set to maximum of %d", MAXFGRAB);
- captCount = MAXFGRAB;
- }
- break;
-
- case 'w':
- writeFrame = 0;
- break;
-
- case 'd':
- displayFrame = 1;
- break;
-
- case 'V':
- verbose = 1;
- break;
-
- case 'T':
- decodeTC = 1;
- break;
-
- case 'D':
- deinterlace = 1;
- break;
-
- case 's':
- xsize = atoi(optarg);
- ysize = atoi(argv[optind]);
- optind++;
- break;
-
- case 'p':
- setVCmdStr(cmdPR, strPR, tcPR, (char *)optarg);
- break;
-
- case 'i':
- setVCmdStr(cmdSI, strSI, tcSI, (char *)optarg);
- inpoint = TRUE;
- break;
-
- case 'o':
- setVCmdStr(cmdSO, strSO, tcSO, (char *)optarg);
- outpoint = TRUE;
- break;
-
- case 'O':
- offset = atoi(optarg);
- break;
-
- case 'n':
- devicenum = atoi(optarg);
- break;
-
- case 'r':
- rawMode = 1;
- break;
-
- case 'v':
- forced_node = 1;
- vin = atoi(optarg);
- break;
-
- case 'z':
- if (sscanf(optarg,"%d/%d",&zoom_num,&zoom_denom) != 2 ||
- !zoom_num || !zoom_denom)
- {
- fprintf(stderr, "%s: ERROR zoom format is <num>/<denom>\n",
- _progName);
- exit(1);
- }
- break;
-
- default:
- case 'h':
- usage();
- exit(0);
- break;
- }
- }
-
- }
-
-
-
- void
- initVideo()
- {
- /* Connect to the daemon */
- if (!(svr = vlOpenVideo("")))
- {
- fprintf(stderr, "%s: couldn't open video\n", _progName);
- exit(1);
- }
-
- signal(SIGINT, docleanup);
-
- /* Get the list of devices that the daemon supports */
- if (vlGetDeviceList(svr, &devlist) < 0)
- {
- printf("%s: getting device list: %s\n",_progName,vlStrError(vlErrno));
- exit(1);
- }
-
- /* Make sure the user specified device (if any) is in the list */
- if ((devicenum >= (int)devlist.numDevices) || (devicenum < -1))
- {
- if (devlist.numDevices == 1)
- fprintf(stderr,"%s: The device number must be 0\n",_progName);
- else
- fprintf(stderr,"%s: The device number must be between 0 and %d\n",
- _progName, devlist.numDevices-1);
- exit(1);
- }
-
- /* Set up a drain node in memory */
- drn = vlGetNode(svr, VL_DRN, VL_MEM, VL_ANY);
- /* Set up a source node on any source if the user did not specify one */
- if (forced_node == 0)
- src = vlGetNode(svr, VL_SRC, VL_VIDEO, VL_ANY);
- else
- /* Set up a source node on the user specified source */
- src = vlGetNode(svr, VL_SRC, VL_VIDEO, vin);
-
- /*
- * If the user didn't specify a device create a path using the first
- * device that will support it
- */
- if (devicenum == -1)
- {
- if ((path = vlCreatePath(svr, VL_ANY, src, drn)) < 0)
- {
- vlPerror(_progName);
- exit(1);
- }
- /* Get the device number and name */
- devicenum = vlGetDevice(svr, path);
- deviceName = devlist.devices[devicenum].name;
- }
- else
- /* Create a path using the user specified device */
- {
- deviceName = devlist.devices[devicenum].name;
- if ((path = vlCreatePath(svr, devicenum, src, drn)) < 0)
- {
- vlPerror(_progName);
- exit(1);
- }
- }
-
- /* Set up the hardware for and define the usage of the path */
- if (vlSetupPaths(svr, (VLPathList)&path, 1, VL_LOCK, VL_LOCK) < 0)
- {
- vlPerror(_progName);
- exit(1);
- }
-
- /*
- * Specify what path-related events we want to receive.
- * In this example we want transfer complete and transfer failed
- * events only.
- */
- vlSelectEvents(svr, path, VLTransferCompleteMask|VLTransferFailedMask);
-
- /* Set the zoom ratio */
- val.fractVal.numerator = zoom_num;
- val.fractVal.denominator = zoom_denom;
- vlSetControl(svr, path, drn, VL_ZOOM, &val);
-
- if (decodeTC) {
- val.intVal = VL_PACKING_YVYU_422_8;
- val.intVal = VL_PACKING_RGB_8;
- if (vlSetControl(svr, path, drn, VL_PACKING, &val))
- vlPerror("not able to set packing");
-
- /* Set the video size, 10 lines*/
- val.xyVal.x = 0;
- val.xyVal.y = -9;
- if (vlSetControl(svr, path, drn, VL_OFFSET, &val))
- vlPerror("not able to set offset");
-
- vlGetControl(svr, path, drn, VL_OFFSET, &val);
- printf("offset %d, %d\n", val.xyVal.x, val.xyVal.y);
-
- vlGetControl(svr, path, drn, VL_SIZE, &val);
- printf("default xsize = %d ysize = %d\n", val.xyVal.x, val.xyVal.y );
- val.xyVal.y = 10;
- val.xyVal.y = 496;
- vlSetControl(svr, path, drn, VL_SIZE, &val);
- vlGetControl(svr, path, drn, VL_SIZE, &val);
- printf("new xsize = %d ysize = %d\n", val.xyVal.x, val.xyVal.y );
- }
- else {
- /* Set packing to RGB, if rawmode requested use default */
- if (!rawMode)
- {
- val.intVal = VL_PACKING_RGB_8;
- vlSetControl(svr, path, drn, VL_PACKING, &val);
- }
-
- /* Set the video size to what the user requested */
- if (!xsize)
- vlGetControl(svr, path, drn, VL_SIZE, &val);
- else {
- val.xyVal.x = xsetsize = xsize;
- val.xyVal.y = ysetsize = ysize;
- vlSetControl(svr, path, drn, VL_SIZE, &val);
-
- /* Make sure the hardware supports this size */
- vlGetControl(svr, path, drn, VL_SIZE, &val);
- }
- }
-
- if (!xsetsize)
- {
- xsetsize = val.xyVal.x;
- ysetsize = val.xyVal.y;
- }
-
- xsize = val.xyVal.x;
- ysize = val.xyVal.y;
-
- frameSize = vlGetTransferSize(svr, path);
-
- /* Set ProcessEvent() as the callback for a transfer events */
- vlAddCallback(svr, path, VLTransferCompleteMask|VLTransferFailedMask,
- ProcessEvent, NULL);
-
- /* Create and register a buffer of captCount frames... */
- buffer = vlCreateBuffer(svr, path, drn, captCount);
- if (buffer == NULL)
- {
- printf("error create buffer\n");
- exit(1);
- }
- if (vlRegisterBuffer(svr, path, drn, buffer))
- {
- vlPerror(_progName);
- exit(1);
- }
- }
-
-
-
- void
- initVlanEditSeq()
- {
- response = vlan_SendCmd("ST"); /* stop device */
- response = vlan_SendCmd("EF"); /* turn echoing off */
- response = vlan_SendCmd("CO"); /* turn coincidence on */
- printf("Setting grab start : %s\n", tcSI);
- mc_convert(MC_NTSC_FRAME, MC_NTSC_TC, fcntSI, tcTMP); /* convert from tc to frames */
- setVCmdStr(cmdSI, strSI, tcSI, tcTMP);
- response = vlan_SendCmd(cmdSI); /* set edit inpoint */
- mc_convert(MC_NTSC_FRAME, MC_NTSC_TC, fcntSI + MINENDPOINT, tcTMP);
- setVCmdStr(cmdSO, strSO, tcSO, tcTMP);
- response = vlan_SendCmd(cmdSO); /* set edit outpoint */
- setVCmdStr(cmdPR, strPR, tcPR, tcPR);
- response = vlan_SendCmd(cmdPR); /* set preroll time */
- setVCmdStr(cmdSC, strSC, tcSC, tcPR);
- response = vlan_SendCmd(cmdSC); /* set coincidence trigger time */
- response = vlan_SendCmd("RV"); /* start review of edit sequence */
- if (response != NULL && response[0] != '\0')
- fprintf(stdout, "%s\n", response);
- }
-
-
- void
- setNewVlanCaptSeq(int count)
- {
- fcntSI += captCount;
- mc_convert(MC_NTSC_FRAME, MC_NTSC_TC, fcntSI, tcTMP);
- setVCmdStr(cmdSI, strSI, tcSI, tcTMP);
- response = vlan_SendCmd(cmdSI);
- mc_convert(MC_NTSC_FRAME, MC_NTSC_TC, fcntSI + MINENDPOINT, tcTMP);
- setVCmdStr(cmdSO, strSO, tcSO, tcTMP);
- response = vlan_SendCmd(cmdSO);
- response = vlan_SendCmd("RV");
- }
-
-
-
- main(int argc, char **argv)
- {
- div_t tmp;
-
- _progName = argv[0];
-
- setVCmdStr(cmdPR, strPR, tcPR, "00:00:05:00"); /* default preroll time of 5 sec. */
-
- parseOptions(argc, argv);
-
- if (!inpoint) {
- usage();
- exit(0);
- }
-
- /* Ensure that writeFrame is enabled if -d option specified */
- if (displayFrame && !writeFrame)
- {
- writeFrame = 1;
- forcedWriteFrame = 1;
- }
-
-
- if (writeFrame)
- {
- if (outfilename[0] == '\0')
- strcpy(outfilename, GRABFILE);
- }
-
- /* compute total number of frames to grab based on inpoint and outpoint */
- mc_convert(MC_NTSC_TC, MC_NTSC_FRAME, tcSO, &fcntSO);
- mc_convert(MC_NTSC_TC, MC_NTSC_FRAME, tcSI, &fcntSI);
- fcntSI += offset;
- fcntSO += offset;
- totalFrames = fcntSO - fcntSI + 1;
- if (totalFrames <= 0) {
- printf("end frame must be greater than start frame\n");
- exit(-1);
- }
-
- if (captCount == 0) {
- if (totalFrames < MAXFGRAB)
- captCount = totalFrames;
- else
- captCount = MAXFGRAB;
- }
-
- initVideo();
-
- tmp = div(totalFrames, captCount);
- totalTriggers = tmp.quot;
- remFrames = tmp.rem;
- printf("totalFrames = %d totalTriggers %d\n", totalFrames,
- tmp.rem ? totalTriggers + 1 : totalTriggers);
-
- /*
- * Fill the transfer descriptor for a discrete transfer of captCount
- * frames based on a trigger event.
- */
-
- xferDesc.mode = VL_TRANSFER_MODE_DISCRETE;
- xferDesc.count = captCount;
- xferDesc.delay = 0;
- xferDesc.trigger = VLDeviceEvent;
-
- /* Begin the data transfer */
- vlBeginTransfer(svr, path, 1, &xferDesc);
-
- if (vlan_InitPort("/dev/ttyd2") != 0) {
- sprintf(buf, "Can't open %s\n", vlan_port);
- vlan_perror(buf);
- exit(1);
- }
-
- printf("Sending vlan edit setup sequence\n");
-
- initVlanEditSeq();
-
- /* Loop until all requested frames are grabbed */
- vlMainLoop();
- }
-
- /*
- * Handle video library events
- * (only transfer complete and transfer failed events in this example)
- */
- void
- ProcessEvent(VLServer svr, VLEvent *ev, void *data)
- {
- VLInfoPtr info;
- char *dataPtr;
- DMediaInfo *dmInfo;
- int iFrame, msec;
- char tcstr[256];
- int elapsedTime;
- int elapsedFrames;
- static numTrigs = 0;
- static int framesGrabbed = 0;
- static int frames = 0;
-
- switch (ev->reason)
- {
- case VLTransferComplete:
- /* Get the number and location of frames captured */
-
- while ((info = vlGetNextValid(svr, buffer)) == NULL);
- dmInfo = vlGetDMediaInfo(svr, buffer, info);
- if (verbose)
- printf("field sequence # = %d\n", dmInfo->sequence);
-
- /* Get a pointer to the frame(s) */
- dataPtr = vlGetActiveRegion(svr, buffer, info);
-
- frames++;
- framesGrabbed++;
-
- if (decodeTC) {
- }
-
- /* Set the filename if user requested write to disk */
- if (writeFrame) {
- sprintf(iname,"%s-%05d", outfilename, framesGrabbed);
- if (!rawMode)
- strcat(iname, ".rgb");
- else {
- strcat(iname, ".");
- strcat(iname, get_packing());
- }
- }
-
- /* Write the frame(s) to memory (and to disk if requested) */
- DumpImage(dataPtr, xsize, xsetsize, ysize, ysetsize, frameSize);
-
- if (writeFrame && !forcedWriteFrame)
- fprintf(stderr,"%s: saved image to file %s\n", _progName, iname);
-
- /* Write to display if requested */
- if (displayFrame && !rawMode) {
- char cmd[100];
-
- sprintf(cmd, "ipaste %s ", iname);
- system(cmd);
- if (forcedWriteFrame)
- unlink(iname);
- }
-
- /* Finished with frame, unlock the buffer */
- vlPutFree(svr, buffer);
-
- if (frames < captCount)
- break;
-
- ++numTrigs;
-
- if (verbose)
- printf(">> trigger: %d of %d\n", numTrigs, totalTriggers);
-
- frames = 0;
-
- printf("grabbed %d frames\n", captCount);
- vlEndTransfer(svr, path);
-
- if (numTrigs < totalTriggers) {
- xferDesc.count = captCount;
- vlBeginTransfer(svr, path, 1, &xferDesc);
-
- setNewVlanCaptSeq(captCount);
- }
- else if (remFrames) {
- xferDesc.count = captCount;
- vlBeginTransfer(svr, path, 1, &xferDesc);
-
- setNewVlanCaptSeq(remFrames);
- captCount = remFrames;
- remFrames = 0;
- }
- else
- {
- printf("done grabbing frames.\n");
- docleanup();
- }
- break;
-
- case VLTransferFailed:
- fprintf(stderr,"%s: Transfer failed.\n",_progName);
- docleanup();
- break;
-
- default:
- printf("a non-transfer event happened\n");
- break;
- }
- }
-
-
-
- int reportPerf(int reset)
- {
- static int nframes = 0;
- static struct timeval starttime, endtime;
- double perf;
- long lperf;
-
- if (reset)
- gettimeofday(&starttime);
- else {
- gettimeofday(&endtime);
- perf = (((double)((endtime.tv_sec - starttime.tv_sec) * 1000000
- + (endtime.tv_usec - starttime.tv_usec))) / 1000000.0);
- lperf = ((((endtime.tv_sec - starttime.tv_sec) * 1000000
- + (endtime.tv_usec - starttime.tv_usec))));
- starttime = endtime;
- fprintf(stderr, "%6.3f seconds elapsed\n", perf);
- return(lperf);
- }
- }
-
-
- /*
- * Do general cleanup before exiting. All of our resources should
- * be freed.
- */
- void
- docleanup()
- {
- vlEndTransfer(svr, path);
- vlDeregisterBuffer(svr, path, drn, buffer);
- vlDestroyBuffer(svr, buffer);
- vlDestroyPath(svr, path);
- vlCloseVideo(svr);
- exit(0);
- }
-
- char *
- get_packing(void)
- {
- VLControlValue val;
- char *packing;
-
- if (vlGetControl(svr, path, drn, VL_PACKING, &val) < 0)
- vlPerror("Getting VL_PACKING");
-
- switch (val.intVal)
- {
- case VL_PACKING_RGB_8:
- packing = "rgb";
- break;
-
- case VL_PACKING_RGBA_8:
- packing = "rgba";
- break;
-
- case VL_PACKING_RBG_323:
- packing = "rgb323";
- break;
-
- case VL_PACKING_RGB_332_P:
- packing = "rgb332p";
- break;
-
- case VL_PACKING_Y_8_P:
- packing = "yuvluma";
- break;
-
- case VL_PACKING_VUY_411_SV:
- packing = "yuv411";
- break;
-
- case VL_PACKING_YVYU_422_8:
- packing = "yuv422";
- break;
-
- case VL_PACKING_RGB_332:
- packing = "rgb332";
- break;
-
- case VL_PACKING_BGR_332:
- packing = "bgr332";
- break;
-
- case VL_PACKING_RGB_332_IP:
- packing = "rgb332ip";
- break;
-
- case VL_PACKING_BGR_332_P:
- packing = "bgr332p";
- break;
-
- case VL_PACKING_BGR_332_IP:
- packing = "bgr332ip";
- break;
-
- case VL_PACKING_RGB_565:
- packing = "rgb565";
- break;
-
- case VL_PACKING_RGB_565_P:
- packing = "rgb565P";
- break;
-
- case VL_PACKING_RGB_8_P:
- packing = "rgb8p";
- break;
-
- case VL_PACKING_RGB_10:
- packing = "rgb10";
- break;
-
- case VL_PACKING_Y_8_IP:
- packing = "yuvlumaip";
- break;
-
- case VL_PACKING_YUV_444_8:
- packing = "yuv44";
- break;
-
- case VL_PACKING_YUVA_4444_8:
- packing = "yuva444";
- break;
-
- case VL_PACKING_YUV_444_10:
- packing = "yuv44410";
- break;
-
- default:
- packing = "???";
- break;
- }
- return(packing);
- }
-
-
-